package com.example.springinit2.config;

import org.apache.velocity.app.VelocityEngine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration
public class VelocityEngineConfig {
  @Bean
  public VelocityEngine velocityEngine() throws Exception {
	Properties properties = new Properties();
	properties.setProperty("input.encoding", "UTF-8");
	properties.setProperty("output.encoding", "UTF-8");
	properties.setProperty("resource.loader", "class");
	properties.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
	VelocityEngine velocityEngine = new VelocityEngine(properties);
	return velocityEngine;
  }
}
